package com.hust.service;

import com.hust.dao.CommodityDao;
import com.hust.dao.CommodityExample;
import com.hust.domain.Commodity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TestCommodityService {

    @Autowired
    private  CommodityDao commodityDao;

    public List<Commodity> findByUrl(){
        CommodityExample ce=new CommodityExample();
        CommodityExample.Criteria criteria = ce.createCriteria();
        criteria.andCUrlIsNotNull();
        criteria.andCUrlEqualTo("www.baidu.com");
        List<Commodity> commodities = commodityDao.selectByExample(ce);
        return commodities;
    }
}
